inherited rstDebtors: TrstDebtors
  Left = 290
  Top = 133
  Caption = #1056#1077#1077#1089#1090#1088' '#1075#1088#1072#1078#1076#1072#1085
  ClientHeight = 672
  ClientWidth = 970
  OldCreateOrder = True
  ExplicitWidth = 986
  ExplicitHeight = 710
  PixelsPerInch = 96
  TextHeight = 13
  inherited ToolBar1: TToolBar
    Width = 970
    ExplicitWidth = 970
    inherited ToolButton7: TToolButton
      Visible = False
    end
    object tbOuter: TToolButton
      Left = 297
      Top = 0
      Width = 8
      Caption = 'tbOuter'
      ImageIndex = 2
      Style = tbsSeparator
    end
    object ToolButton11: TToolButton
      Left = 305
      Top = 0
      Action = aUseRecord
    end
  end
  inherited DBGridEh1: TDBGridEh
    Width = 970
    Height = 613
    Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit]
    RowHeight = 31
    RowSizingAllowed = True
    OnDblClick = aRecordEditExecute
    Columns = <
      item
        EditButtons = <>
        FieldName = 'ID'
        Footers = <>
        Width = 48
      end
      item
        EditButtons = <>
        FieldName = 'NAME'
        Footers = <>
        Width = 132
      end
      item
        EditButtons = <>
        FieldName = 'BIRTH_DATE'
        Footers = <>
      end
      item
        EditButtons = <>
        FieldName = 'STREET'
        Footers = <>
        Width = 156
      end
      item
        EditButtons = <>
        FieldName = 'HOUSE'
        Footers = <>
        Width = 32
      end
      item
        EditButtons = <>
        FieldName = 'APPARTS'
        Footers = <>
        Width = 23
      end
      item
        EditButtons = <>
        FieldName = 'NOTES'
        Footers = <>
        Width = 91
      end
      item
        EditButtons = <>
        FieldName = 'PHONE_HOME'
        Footers = <>
        Width = 61
      end
      item
        EditButtons = <>
        FieldName = 'PHONE_CELL'
        Footers = <>
      end
      item
        EditButtons = <>
        FieldName = 'DT_CNT'
        Footers = <>
      end
      item
        EditButtons = <>
        FieldName = 'DT_SUMMA'
        Footers = <>
      end>
  end
  inherited StatusBar1: TStatusBar
    Top = 653
    Width = 970
    ExplicitTop = 653
    ExplicitWidth = 970
  end
  inherited ActionList1: TActionList
    object aUseRecord: TAction
      Caption = #1048#1089#1087#1086#1083#1100#1079#1086#1074#1072#1090#1100' '#1074#1099#1073#1088#1072#1085#1085#1091#1102' '#1079#1072#1087#1080#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1076#1086#1083#1075#1072
      Hint = #1048#1089#1087#1086#1083#1100#1079#1086#1074#1072#1090#1100' '#1074#1099#1073#1088#1072#1085#1085#1091#1102' '#1079#1072#1087#1080#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1076#1086#1083#1075#1072
      ImageIndex = 32
      OnExecute = aUseRecordExecute
    end
  end
  inherited dsReestr: TpFIBDataSet
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    RST_DEBTORS'
      'WHERE'
      '        ID = :OLD_ID'
      '    ')
    RefreshSQL.Strings = (
      'select'
      '    dr.id,'
      '    dr.name,'
      '    dr.birth_date,'
      '    dr.street,'
      '    dr.house,'
      '    dr.apparts,'
      '    dr.notes,'
      '    dr.phone_home,'
      '    dr.phone_cell,'
      '    (select count(1)'
      '        from rst_debts dt where dt.debtor_id = dr.id'
      '          and dt.closed = 0 and dt.is_deleted = 0) as dt_cnt,'
      '    (select sum(dt.summa_cur)'
      '        from rst_debts dt where dt.debtor_id = dr.id'
      '          and dt.closed = 0 and dt.is_deleted = 0) as dt_summa'
      'from'
      '    rst_debtors dr'
      ''
      ' WHERE '
      '        DR.ID = :OLD_ID'
      '    ')
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME,'
      '    BIRTH_DATE,'
      '    STREET,'
      '    HOUSE,'
      '    APPARTS,'
      '    NOTES,'
      '    PHONE_HOME,'
      '    PHONE_CELL,'
      '    DT_CNT,'
      '    DT_SUMMA'
      'FROM'
      '    PR_RST_DEBTORS(:PMAINPARAMS,'
      '    :PADDPARAMS) ')
    UpdateTransaction = MAINDM.MainTransaction
    object dsReestrID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'ID'
    end
    object dsReestrNAME: TFIBStringField
      DisplayLabel = #1060#1048#1054
      FieldName = 'NAME'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReestrBIRTH_DATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072' '#1088#1086#1078#1076'.'
      FieldName = 'BIRTH_DATE'
      DisplayFormat = 'dd.mm.yyyy'
    end
    object dsReestrSTREET: TFIBStringField
      DisplayLabel = #1059#1083#1080#1094#1072
      FieldName = 'STREET'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReestrHOUSE: TFIBStringField
      DisplayLabel = #1044#1086#1084
      FieldName = 'HOUSE'
      Size = 16
      EmptyStrToNull = True
    end
    object dsReestrAPPARTS: TFIBStringField
      DisplayLabel = #1050#1074'.'
      FieldName = 'APPARTS'
      Size = 16
      EmptyStrToNull = True
    end
    object dsReestrNOTES: TFIBStringField
      DisplayLabel = #1047#1072#1084#1077#1090#1082#1080
      FieldName = 'NOTES'
      Size = 255
      EmptyStrToNull = True
    end
    object dsReestrPHONE_HOME: TFIBStringField
      DisplayLabel = #1044#1086#1084'. '#1090#1077#1083#1077#1092#1086#1085
      FieldName = 'PHONE_HOME'
      Size = 16
      EmptyStrToNull = True
    end
    object dsReestrPHONE_CELL: TFIBStringField
      DisplayLabel = #1057#1086#1090#1086#1074#1099#1081
      FieldName = 'PHONE_CELL'
      Size = 16
      EmptyStrToNull = True
    end
    object dsReestrDT_CNT: TFIBIntegerField
      DisplayLabel = #1044#1086#1083#1075#1086#1074'|'#1050#1086#1083'-'#1074#1086
      FieldName = 'DT_CNT'
    end
    object dsReestrDT_SUMMA: TFIBBCDField
      DisplayLabel = #1044#1086#1083#1075#1086#1074'|'#1057#1091#1084#1084#1072
      FieldName = 'DT_SUMMA'
      DisplayFormat = '#,##0.00'
      EditFormat = '0.00'
      Size = 2
      RoundByScale = True
    end
  end
  object qCloseDebtor: TpFIBQuery
    Transaction = trMassOperations
    Database = MAINDM.MainDB
    SQL.Strings = (
      'update rst_debtors dr set dr.is_deleted = 1'
      'where dr.id = :pdebtor_id')
    Left = 34
    Top = 236
    qoAutoCommit = True
    qoStartTransaction = True
  end
  object trMassOperations: TpFIBTransaction
    DefaultDatabase = MAINDM.MainDB
    TimeoutAction = TARollback
    Left = 70
    Top = 208
  end
end
